Skip to content

Honour isrecursive above listall#6045

Merged
nvazquez merged 6 commits into
apache:mainfrom
shapeblue:fix-recursive
Mar 11, 2022
Merged

Honour isrecursive above listall#6045
nvazquez merged 6 commits into
apache:mainfrom
shapeblue:fix-recursive

Conversation

@davidjumani

@davidjumani davidjumani commented Feb 28, 2022

Copy link
Copy Markdown
Contributor

Description

Fixes #4868

Prior to this, if listall was set to true, it would recursively list all resources irrespective of the value of isrecursive. This PR fixes it

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

Before :

(localhost) 🐱 > list accounts filter=name,domain listall=true isrecursive=false
{
  "account": [
    {
      "domain": "ROOT",
      "name": "admin"
    },
    {
      "domain": "ROOT",
      "name": "baremetal-system-account"
    },
    {
      "domain": "domain",
      "name": "domain"
    },
    {
      "domain": "sub",
      "name": "user"
    }
  ],
  "count": 4
}

After :

(localhost) 🐱 > list accounts filter=name,domain listall=true isrecursive=false
{
  "account": [
    {
      "domain": "ROOT",
      "name": "admin"
    },
    {
      "domain": "ROOT",
      "name": "baremetal-system-account"
    }
  ],
  "count": 2
}

@davidjumani davidjumani force-pushed the fix-recursive branch 3 times, most recently from 1c8b5a0 to 74516df Compare February 28, 2022 07:37
@DaanHoogland

Copy link
Copy Markdown
Contributor

@davidjumani , would it make sense to let isRecursive() return a different default value, depending on whether listall is given? this seems like a very elaborate way to guard against a discrepancy, introducing a lot of null.
I would think an extra bit of check in the existing getter, will greatly reduce the size of the change as well as the complexity of it, and it will limit the check to the API, where I think it belongs.

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good

@davidjumani davidjumani force-pushed the fix-recursive branch 2 times, most recently from 0678a01 to 101d2a0 Compare February 28, 2022 10:46
@nvazquez nvazquez added this to the 4.17.0.0 milestone Mar 5, 2022
@nvazquez

nvazquez commented Mar 5, 2022

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2769

@nvazquez

nvazquez commented Mar 5, 2022

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3503)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 40165 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6045-t3503-kvm-centos7.zip
Smoke tests completed. 80 look OK, 12 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_redundant_vpc_site2site_vpn Error 243.71 test_vpc_vpn.py
test_01_vpc_site2site_vpn_multiple_options Error 159.95 test_vpc_vpn.py
test_01_vpc_remote_access_vpn Failure 77.35 test_vpc_vpn.py
test_01_vpc_site2site_vpn Error 153.00 test_vpc_vpn.py
test_DeleteDomain Error 151.69 test_accounts.py
test_forceDeleteDomain Failure 151.60 test_accounts.py
test_01_create_lb_rule_src_nat Error 0.02 test_loadbalance.py
test_02_redundant_VPC_default_routes Failure 330.17 test_vpc_redundant.py
test_isolate_network_password_server Error 0.05 test_password_server.py
test_router_dhcphosts Error 0.04 test_router_dhcphosts.py
test_router_dhcp_opts Error 0.06 test_router_dhcphosts.py
test_01_create_delete_portforwarding_fornonvpc Error 1.70 test_portforwardingrules.py
test_add_multiple_admins_in_project Failure 9.59 test_enable_role_based_users_in_projects.py
test_router_dns_externalipquery Error 0.04 test_router_dns.py
test_router_dns_guestipquery Error 0.03 test_router_dns.py
test_router_dns_guestipquery Error 0.04 test_router_dnsservice.py
test_01_isolate_network_FW_PF_default_routes_egress_true Error 73.52 test_routers_network_ops.py
test_02_isolate_network_FW_PF_default_routes_egress_false Error 73.48 test_routers_network_ops.py
test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true Error 133.80 test_routers_network_ops.py
test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false Error 121.72 test_routers_network_ops.py
test_delete_account Error 76.80 test_network.py
test_01_port_fwd_on_src_nat Error 0.02 test_network.py
test_public_ip_admin_account Error 1.11 test_network.py
test_public_ip_user_account Error 1.11 test_network.py
test_reboot_router Error 181.73 test_network.py
test_releaseIP Error 62.59 test_network.py

@nvazquez

nvazquez commented Mar 8, 2022

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3523)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 35918 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6045-t3523-kvm-centos7.zip
Smoke tests completed. 81 look OK, 11 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_redundant_vpc_site2site_vpn Error 244.74 test_vpc_vpn.py
test_01_vpc_site2site_vpn_multiple_options Error 150.97 test_vpc_vpn.py
test_01_vpc_remote_access_vpn Failure 76.39 test_vpc_vpn.py
test_01_vpc_site2site_vpn Error 162.46 test_vpc_vpn.py
test_DeleteDomain Error 152.77 test_accounts.py
test_forceDeleteDomain Failure 151.69 test_accounts.py
test_01_create_lb_rule_src_nat Error 0.02 test_loadbalance.py
test_isolate_network_password_server Error 0.04 test_password_server.py
test_router_dhcphosts Error 0.04 test_router_dhcphosts.py
test_router_dhcp_opts Error 0.07 test_router_dhcphosts.py
test_01_create_delete_portforwarding_fornonvpc Error 1.84 test_portforwardingrules.py
test_add_multiple_admins_in_project Failure 9.75 test_enable_role_based_users_in_projects.py
test_router_dns_externalipquery Error 0.04 test_router_dns.py
test_router_dns_guestipquery Error 0.04 test_router_dns.py
test_router_dns_guestipquery Error 0.04 test_router_dnsservice.py
test_01_isolate_network_FW_PF_default_routes_egress_true Error 76.39 test_routers_network_ops.py
test_02_isolate_network_FW_PF_default_routes_egress_false Error 74.35 test_routers_network_ops.py
test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true Error 117.42 test_routers_network_ops.py
test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false Error 127.93 test_routers_network_ops.py
test_delete_account Error 76.82 test_network.py
test_01_port_fwd_on_src_nat Error 0.02 test_network.py
test_public_ip_admin_account Error 1.14 test_network.py
test_public_ip_user_account Error 1.12 test_network.py
test_reboot_router Error 181.99 test_network.py
test_releaseIP Error 62.99 test_network.py

@davidjumani

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2803

@davidjumani

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@davidjumani davidjumani marked this pull request as ready for review March 9, 2022 08:10
@blueorangutan

Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@yadvr yadvr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but requires manual testing or check/add new unit/marvin tests to cover the new changes.

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3536)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 31966 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6045-t3536-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez

nvazquez commented Mar 9, 2022

Copy link
Copy Markdown
Contributor

@davidjumani can you please fix the conflicts?

@davidjumani

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2824

@davidjumani

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3555)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 31473 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6045-t3555-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez nvazquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - manually tested:

  • Test domains defined as:

Screen Shot 2022-03-10 at 23 47 17

  • Created an account per domain

  • As ROOT admin: isrecursive being honoured over listall:

(localcloud) 🐱 > list accounts filter=id,name,domain listall=true isrecursive=false
{
  "account": [
    {
      "domain": "ROOT",
      "id": "2ffb598d-9d5e-11ec-8765-0200346f0009",
      "name": "admin"
    },
    {
      "domain": "ROOT",
      "id": "89b3f8d1-8a9d-42fa-8249-b85dc86e29e6",
      "name": "baremetal-system-account"
    }
  ],
  "count": 2
}
(localcloud) 🐱 > list accounts filter=id,name,domain listall=true isrecursive=true
{
  "account": [
    {
      "domain": "ROOT",
      "id": "2ffb598d-9d5e-11ec-8765-0200346f0009",
      "name": "admin"
    },
    {
      "domain": "ROOT",
      "id": "89b3f8d1-8a9d-42fa-8249-b85dc86e29e6",
      "name": "baremetal-system-account"
    },
    {
      "domain": "sub",
      "id": "e7da4a05-1224-4518-9379-1096962173b2",
      "name": "user"
    },
    {
      "domain": "subsub",
      "id": "1fae52cd-bbcf-43bc-8c4b-e41c7197b349",
      "name": "subsubdomadmin"
    },
    {
      "domain": "nested",
      "id": "140e22a8-859d-4ee8-a34c-e198cad9417d",
      "name": "nesteduser"
    }
  ],
  "count": 5
}
  • As a user on domain sub:
  • if 'allow.users.view.all.domain.accounts' = true:
(localcloud) 🐱 > list accounts filter=id,name,domain listall=true isrecursive=true
{
  "account": [
    {
      "domain": "sub",
      "id": "e7da4a05-1224-4518-9379-1096962173b2",
      "name": "user"
    }
  ],
  "count": 1
}
(localcloud) 🐱 > list accounts filter=id,name,domain listall=true isrecursive=false
{
  "account": [
    {
      "domain": "sub",
      "id": "e7da4a05-1224-4518-9379-1096962173b2",
      "name": "user"
    }
  ],
  "count": 1
}

@nvazquez nvazquez merged commit 7105619 into apache:main Mar 11, 2022
nvazquez added a commit that referenced this pull request Mar 16, 2022
nvazquez added a commit that referenced this pull request Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

isrecursive not honoured for listAccounts, maybe others as well

5 participants